/**
 * Created by YJH on 2018/5/24.
 */
import React, {Component} from 'react';
import {
    StyleSheet,
    Text,
    View,
    TouchableOpacity,
    Image,
} from 'react-native';
import GirlComponent from './GirlComponent'

import NavigationBarComponent from './NavigationBarComponent';

export default class BoyComponent extends Component<Props> {

    constructor(props) {
        super(props);
        this.state = {
            word: '',
        }
    }

    render() {
        return (
            <View style={styles.container}>
                <NavigationBarComponent
                    title={'HELLO BOY'}
                    statusBar={{
                        backgroundColor: 'green'
                    }}
                     style={{backgroundColor:'green'}}
                />
                <Text style={styles.boy_text}>我是一个纯爷们儿</Text>
                <Text style={styles.boy_text}
                      onPress={() => {
                          this.props.navigator.push({
                              component: GirlComponent,
                              params: {
                                  word: '一枝红玫瑰',
                                  onCallBack: (word) => {
                                      this.setState({
                                          word: word,
                                      })
                                  }
                              }
                          })
                      }}>向女孩送花</Text>

                <Text style={styles.boy_text}>{this.state.word}</Text>

            </View>
        )
    }
}

const styles = StyleSheet.create(
    {
        container: {
            flex: 1,
        },

        boy_text: {
            fontSize: 18,
            // color: 'black',
            // alignSelf: 'center',
        }
    }
)